#region 模块信息
// **********************************************************************
// 创建时间(CreateTime):           2019/3/22 11:48:53
// 模块描述(Module description):   泛型单例类
// **********************************************************************
#endregion

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Singleton<T> :IDisposable where T:new()
{

    private static T mInstance;
    private static readonly object mLocker=new object();

    public static T Instance
    {
        get
        {
            if (mInstance == null)
            {
                lock (mLocker)
                {
                    if (mInstance == null)
                    {
                        return new T();
                    }
                }
            }
            return mInstance;
        }
    }

    public void Dispose()
    {
        
    }
}
